import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import pluginVue from 'eslint-plugin-vue';

/** @type {import('eslint').Linter.Config[]} */
export default [
    {
        files: ['**/*.{js,mjs,cjs,ts,vue}'],
        ignores: [
            'node_modules/',
            '*.md',
            '.vscode/',
            '.idea/',
            'dist/',
            'public/',
            'docs/',
            '.husky/',
            '.local/',
            'bin/',
            'Dockerfile',
        ],
        rules: {
            'vue/multi-word-component-names': 'off',
            '@typescript-eslint/no-explicit-any': ['off'],
        },
    },
    {
        languageOptions: { globals: { ...globals.browser } },
        rules: {
            'vue/multi-word-component-names': 'off',
            '@typescript-eslint/no-explicit-any': ['off'],
        },
    },
    pluginJs.configs.recommended,
    ...tseslint.configs.recommended,
    ...pluginVue.configs['flat/essential'],
    {
        files: ['**/*.vue'],
        languageOptions: { parserOptions: { parser: tseslint.parser } },
        ignores: [
            'node_modules/',
            '*.md',
            '.vscode/',
            '.idea/',
            'dist/',
            'public/',
            'docs/',
            '.husky/',
            '.local/',
            'bin/',
            'Dockerfile',
        ],
        rules: {
            'vue/multi-word-component-names': 'off',
            '@typescript-eslint/no-explicit-any': ['off'],
        },
        extends: ['./.eslintrc-auto-import.json'],
    },
];
